package org.hubwork.base.common;

import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

@Service
public class HubBusinessImplJDBC implements HubBusiness{

	@Transactional(propagation = Propagation.REQUIRED, rollbackFor=Throwable.class)
	public void runTX() throws Exception{
		HubT1 ht1 = new HubT1();
		ht1.setId(5);
		ht1.setName("hub55");
		HubT2 ht2 = new HubT2();
		ht2.setId(6);
		ht2.setName("hub66");
		HubApplicationContext.get(HubT1DAOImplJDBC.class).save(ht1);
		HubApplicationContext.get(HubT2DAOImplJDBC.class).save(ht2);	
		throw new Exception();
	}
}
